<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <link rel="stylesheet" href="style.css">
  <script src="https://cdn.polyfill.io/v1/polyfill.js?features=Element.prototype.closest"></script>
  <script src="menu.js"></script>
</head>

<body>

  <button onclick="menu.toggle()">menu.toggle()</button>
  <button onclick="menu.open()">menu.open()</button>
  <button onclick="menu.close()">menu.close()</button>

  <script>
    var menu = new Menu({
      title: "Сладости",
      items: [
        "Торт",
        "Пончик",
        "Пирожное",
        "Шоколадка",
        "Мороженое"
      ]
    });

    document.body.appendChild(menu.getElem());
  </script>

</body>

</html>